const express = require('express')
const router = express.Router()

const profileHandler = require('../router_handler/profile')
// 导入验证数据合法性的中间件
const expressJoi = require('@escook/express-joi')
const {reg_add_schema} = require('../schema/profile')

//创建信息
router.post('/add',expressJoi(reg_add_schema),profileHandler.add)
//获取所有信息
router.get('/',profileHandler.get)
//获取单个信息
router.get('/:id',profileHandler.getinfo)
//编辑单个信息
router.post('/edit/:id',profileHandler.editinfo)
//删除单个信息
router.post('/delete/:id',profileHandler.deleteinfo)

// router.post('/addtest',profileHandler.addtest)

module.exports = router